﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Groovy_IM.Assets;

namespace Groovy_IM
{
    public partial class MessagePage : PhoneApplicationPage
    {
        private int MsgID;

        public MessagePage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            string msg = "";

            if (NavigationContext.QueryString.TryGetValue("MsgID", out msg))
            {
                MsgID = int.Parse(msg);

                this.imText.DataContext = App.Chats[1][MsgID].iViewModel;
            }
        }

        private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
        {
            if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
            {
                imWidth.Width = 455;
                imText.Width = 455;
                imSend.Width = 455;
            }
            else
            {
                imWidth.Width = 775;
                imText.Width = 775;
                imSend.Width = 775;
            }
        }

    }
}